package com.zhuiwei.bigdaa.hbase.hbase;

import org.apache.hadoop.hbase.HBaseConfiguration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zhuiwei
 * @version 2019
 */
@Configuration
public class HbaseConfig {
    @Value("${hbase.zookeeper.quorum}")
    private String zkNodes;
    @Value("${hbase.zookeeper.property.clientPort}")
    private String zkPort;

    @Bean
    public HbaseService getHbaseService(){
        org.apache.hadoop.conf.Configuration conf = HBaseConfiguration.create();
        conf.set("hbase.zookeeper.quorum",zkNodes );
        conf.set("hbase.zookeeper.property.clientPort", zkPort);
        return new HbaseService(conf);
    }
}
